package com.dingreading.cloud.admin.service;

import com.dingreading.cloud.admin.dto.StoreProjectCycleDto;
import com.dingreading.cloud.admin.entity.StoreProjectCycle;
import com.dingreading.cloud.common.util.PageUtil;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;

import java.util.List;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2023-11-22
 */
public interface StoreProjectCycleService extends IService<StoreProjectCycle> {

    Page<StoreProjectCycle> pageList(PageUtil pageUtil, String keyword, Integer enabled);

    boolean haveName(String uid, String projectUid, String name);

    boolean updateEnabled(String uid, Integer enabled, String staffUid, String staffName);

    int dropBean(String uid);

    int getMaxShowOrder(String projectUid);

    StoreProjectCycle getGtOrderNum(String projectUid, Integer orderNum);

    StoreProjectCycle getLtOrderNum(String projectUid, Integer orderNum);

    // 设置序号
    boolean updateOrderNum(String uid, Integer orderNum, String staffUid, String staffName);

    StoreProjectCycle getByUid(String uid);

    List<StoreProjectCycleDto> listByProjectUidAndSourceAndEnabled(String projectUid, Integer source, Integer enabled);

    boolean updateInfo(
            String uid, String cycleName, Integer days, Integer lessons, Double totalAmount, Double unitAmount,
            String staffUid, String staffName
    );

}
